//
//  UITabBar+AWTheme.m
//  changeShin
//
//  Created by Alan Wang on 2019/3/26.
//  Copyright © 2019 Alan Wang. All rights reserved.
//

#import "UITabBar+AWTheme.h"
#import "NSObject+AWTheme.h"
#import "AWThemeManager.h"

@implementation UITabBar (AWTheme)
-(void)AWTheme_UnselectedItemTintColorForKey:(NSString*)key{
    AWweakify(self)
    [self saveBlok:^{
        AWstrongify(self)
        self.unselectedItemTintColor = [[AWThemeManager shareInstance] colorForKey:key];
    } forKey:@"unselectedItemTintColor"];
}
//barTintColor
-(void)AWTheme_BarTintColorForKey:(NSString*)key{
    AWweakify(self)
    [self saveBlok:^{
        AWstrongify(self)
        self.barTintColor = [[AWThemeManager shareInstance] colorForKey:key];
    } forKey:@"barTintColor"];
}
//backgroundImage
-(void)AWTheme_BackgroundImageForKey:(NSString*)key{
    AWweakify(self)
    [self saveBlok:^{
        AWstrongify(self)
        self.backgroundImage = [[AWThemeManager shareInstance] imageForKey:key];
    } forKey:@"backgroundImage"];
}
//backgroundImage
-(void)AWTheme_BackgroundImage:(UIImage*)image{
    AWweakify(self)
    [self saveBlok:^{
        AWstrongify(self)
        self.backgroundImage = image;
    } forKey:@"backgroundImage"];
}


//居于buddle的图片
-(void)AWTheme_BackgroundImageForName:(NSString*)key fromBuddleName:(NSString*)bundleName{
    AWweakify(self)
    [self saveBlok:^{
        AWstrongify(self)
        self.backgroundImage = [[AWThemeManager shareInstance] imageForName:key fromBudddle:bundleName];
    } forKey:@"backgroundImage"];
    
}
@end
